package client

import (
	"net/http"

	"github.com/dghubble/sling"
)

func Http(succResp, errResp any, fn func(*sling.Sling) *sling.Sling) (*http.Response, error) {
	s := sling.New()
	s.Set("Content-Type", "application/json")
	s = fn(s)

	return s.Receive(succResp, errResp)
}
